<?php

namespace App\Models\Manager;

use App\Models\User;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Permission extends Model
{
    use HasFactory;

    protected $primaryKey = 'id';

    protected $fillable = [
        'id',
        'permissionName',
        'description',
        'categoryId',
        'remark'
    ];

    public $timestamps = false;

    /**
     * 在联合查询时隐藏中间表属性
     * @var string[]
     */
    protected $hidden = [

    ];

    public function user(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
    {
        return $this->belongsToMany(User::class);
    }
}
